<template>
  <div class="aboutUs">
    <div class="table">
      <!-- <img src="@/assets/images/news_table.png" alt /> -->
      <p>{{ text }}</p>
    </div>
    <div class="two_nav clearfloat">
      <div class="two_nav_title">私たちに関しては</div>
      <div class="item_box">
        <swiper ref="swiper_aboutUs" :options="swiperOption">
          <swiper-slide class="swiper-slide">
            <router-link   @click.native="onSlide('概観')"  :to="{name:'jap_overview'}" class="two_nav_item">
              <span>概観</span>
            </router-link>
          </swiper-slide>
          <swiper-slide class="swiper-slide">
            <router-link  @click.native="onSlide('名誉')" :to="{name:'jap_honor'}" class="two_nav_item">
              <span>名誉</span>
            </router-link>
          </swiper-slide>
          <swiper-slide class="swiper-slide">
            <router-link  @click.native="onSlide('責任')" :to="{name:'jap_duty'}" class="two_nav_item">
              <span>責任</span>
            </router-link>
          </swiper-slide>
          <!-- <swiper-slide class="swiper-slide">
            <router-link exact :to="{name:'jap_lectureHall'}" class="two_nav_item">
              <span>講堂</span>
            </router-link>
          </swiper-slide> -->
        </swiper>
        
      </div>
    </div>
          <keep-alive :include="/honor|duty|lectureHall/">
      <router-view></router-view>
    </keep-alive>
  </div>
</template>
<script>
export default {
  data() {
    return {
      swiperOption: {
        slidesPerView: 'auto',
        spaceBetween: 0,
        // 鼠标控制滚动
        // mousewheel: {
        //   releaseOnEdges: true
        // },
        //设置点击箭头
        navigation: {
          nextEl: "#swiper-button-next",
          prevEl: "#swiper-button-prev",
        },
        observer: true, //修改swiper自己或子元素时，自动初始化swiper
        observeParents: false, //修改swiper的父元素时，自动初始化swiper
        onSlideChangeEnd: function (swiper) {
          swiper.update();
          mySwiper.startAutoplay();
          mySwiper.reLoop();
        },
        //鼠标变成抓手型
        grabCursor: true,
        //开启鼠标滚轮控制Swiper切换
        // mousewheel: true,
      },
    };
  },
  mounted() {
      try {
           this.text = this.$route.query.titleText;
      } catch (error) {
           this.text = "概観";
      }
  },
  created() {
    // if (this.$store.state.headTitle.equipment == "mobile") {
    //   this.swiperOption.slidesPerView = 4;
    // }
  },
  watch: {
       "$route.query.titleText": {
      deep: true,
      handler: function(newValue, oldValue) {
        this.text = newValue;
      }
    }
  //   "$store.state.headTitle.equipment": {
  //     deep: true,
  //     handler: function (newValue, oldValue) {
  //       if (newValue == "pc") {
  //         this.$refs.swiper_aboutUs.swiper.params.slidesPerView = 6;
  //       } else {
  //         this.$refs.swiper_aboutUs.swiper.params.slidesPerView = 4;
  //       }
  //       // this.$refs.swiper.update();
  //     },
  //   },
  },
  methods: {
       onSlide(text) {
      this.text = text;
    }
  },
};
</script>
<style scoped src="./sass/aboutUs.css"></style>
